export default function(promise) {
  if (!promise || !Promise.prototype.isPrototypeOf(promise)) {
    return new Promise((resolve, reject) => {
      reject(new Error('requires promises as the param'))
    }).catch((err) => {
      return [err, undefined]
    })
  }
  return promise.then(function() {
    return [undefined, ...arguments]
  }).catch(err => {
    return [err, undefined]
  })
}
